package com.yht.config.api;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 鱼仔
 * @date 2021/8/12 10:50 上午
 * 概要
 */

/**
 * 在要刷新的类上,变量上打上@RefreshScope的注解
 */
@RefreshScope
@RestController
public class TestController {

    @Value("${info.profile}")
    private String from;

    @GetMapping("/from")
    public String from() {
        return this.from;
    }
}
